package com.frxuexi.shop.adapter

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.base.entity.CommentBeanItem
import com.frxuexi.base.utils.GlideUtil
import com.frxuexi.shop.R
import com.frxuexi.shop.databinding.ItemReplyBinding

class CommentAdapter:BaseQuickAdapter<CommentBeanItem,BaseViewHolder>(R.layout.item_reply) {

    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemReplyBinding>(viewHolder.itemView)
    }

    override fun convert(helper: BaseViewHolder, item: CommentBeanItem) {
        val binding = DataBindingUtil.getBinding<ItemReplyBinding>(helper.itemView)!!
        binding.bean=item
        GlideUtil.loadRoundImage(binding.replyIv,item.avatar)
    }
}